<?xml version="1.0" encoding="UTF-8"?><!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
        "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html lang="zh" xmlns="http://www.w3.org/1999/xhtml">
<head>
    <meta content="text/html;charset=UTF-8" http-equiv="Content-Type"/>
    <link href="../jacoco-resources/report.css" rel="stylesheet" type="text/css"/>
    <link href="../jacoco-resources/report.gif" rel="shortcut icon" type="image/gif"/>
    <title>Repay.java</title>
    <link href="../jacoco-resources/prettify.css" rel="stylesheet" type="text/css"/>
    <script src="../jacoco-resources/prettify.js" type="text/javascript"></script>
</head>
<body onload="window['PR_TAB_WIDTH']=4;prettyPrint()">
<div class="breadcrumb" id="breadcrumb"><span class="info"><a class="el_session"
                                                              href="../jacoco-sessions.html">Sessions</a></span><a
        class="el_report" href="../index.html">LogicalCoverageCaseStudy$RepayStatementCoverageTest.exec</a> &gt; <a
        class="el_package" href="index.source.html">edu.sei.st.logicalcoverage</a> &gt; <span class="el_source">Repay.java</span>
</div>
<h1>Repay.java</h1>
<pre class="source lang-java linenums">package edu.sei.st.logicalcoverage;

import java.math.BigDecimal;

public class Repay {

    private boolean isCardValid;
    private boolean isNameValid;
    private BigDecimal balance;

    private boolean  isTotal;
    private boolean  isPart;

    private BigDecimal payment;

<span class="fc" id="L16">    public Repay(boolean isCardValid, boolean isNameValid, BigDecimal balance, boolean isTotal, boolean isPart, BigDecimal payment) {</span>
<span class="fc" id="L17">        this.isCardValid = isCardValid;</span>
<span class="fc" id="L18">        this.isNameValid = isNameValid;</span>
<span class="fc" id="L19">        this.balance = balance;</span>
<span class="fc" id="L20">        this.isTotal = isTotal;</span>
<span class="fc" id="L21">        this.isPart = isPart;</span>
<span class="fc" id="L22">        this.payment = payment;</span>
<span class="fc" id="L23">    }</span>

    public String doRepay(){

<span class="pc bpc" id="L27" title="2 of 6 branches missed.">        if (isCardValid &amp;&amp; isNameValid &amp;&amp; balance.compareTo(BigDecimal.ZERO)&gt;0) {</span>
<span class="pc bpc" id="L28" title="1 of 4 branches missed.">            if(isTotal || isPart){</span>
<span class="fc bfc" id="L29" title="All 2 branches covered.">                if(payment.compareTo(new BigDecimal(10.00))&gt;=0)</span>
<span class="fc" id="L30">                    return &quot;success&quot;;</span>
                else
<span class="fc" id="L32">                    return &quot;not enough balance &quot;;</span>
                }
            else
<span class="fc" id="L35">                return &quot;return&quot;;</span>
        }
        else
<span class="fc" id="L38">            return &quot;card invalid or name invalid or balance &lt;=0 &quot;;</span>
    }
}
</pre>
<div class="footer"><span class="right">Created with <a href="http://www.jacoco.org/jacoco">JaCoCo</a> 0.8.7.202105040129</span>
</div>
</body>
</html>
